/**
 * content
 * ibio-develop
 */
(function(){
var VERSION = 2012110108;
var temp = [
'<div style="height:48px; width:100%; background:LightSkyBlue; color:#004080; font-size:12px; font-family:Arial;">',
'   <img id="ex-head" />',
'   <button id="ex-get-all" >get all votes</button>',
'   <span>choose the speed of vote:</span>',
'    <select id="ex-select-sceond">',
'      <option value="1">1 Second</option>',
'      <option value="2">2 Seconds</option>',
'      <option value="5" selected="selected">5 Seconds</option>',
'      <option value="10">10 Seconds</option>',
'      <option value="60">1 Minute</option>',
'      <option value="300">5 Minutes</option>',
'      <option value="600">10 Minutes</option>',
'    </select>',
'    <span id="ex-info"></span>',
'    <span>Ver:' + VERSION + '</span>',
'</div>',
].join('');

// http://www.iqiyi.com/weidianying/jyyyxyh.html
if(document.location.href.indexOf("jyyyxyh") > -1){
    init();
}

//
function init(resp){
    createUI();
    removeSomething();
    //用于跨域
    //inject to current domain
    injectJS();
}

function removeSomething(){
    $(".wrap2").css("background", "white");
    $(".scjsCon").remove();
    $(".header").remove();
}

function createUI(){
    $("body").prepend(temp);
    $("#ex-head").attr("src", chrome.extension.getURL("images/48.png"));
}

function injectJS(){
    var node = document.createElement('script');
    var url = chrome.extension.getURL("contents/override.js?v=" + VERSION);
    node.setAttribute('type', 'text/javascript');            
    node.setAttribute('src', url);
    document.getElementsByTagName('head')[0].appendChild(node);
}

}).call(this);
